# 李广龙
echo minio版本RELEASE.2022-08-02T23-59-16Z
# 数据文件在当前子目录/data下
SERVICE_PATH="/data"
SERVICE_NAME="minio"
MINIO_ACCESS_KEY="admin"
MINIO_SECRET_KEY="eagleminio"
# 服务端口
#PORT1="9000"
# web端口
#PORT2="9090"




creatConfig() {
mkdir -p $SERVICE_PATH/minio/data
}
creatStart() {
  creatConfig
  start
}

start() {
  docker run --network host --name minio -d --restart=always -e "MINIO_ACCESS_KEY=$MINIO_ACCESS_KEY" -e "MINIO_SECRET_KEY=$MINIO_SECRET_KEY" -v $SERVICE_PATH/data:/data  minio/minio server /data --console-address ":9090" -address ":9000"
  docker ps -a | grep $SERVICE_NAME
  echo $SERVICE_NAME"---->运行成功！"
  echo "完成!"
}

read -p '输入功能编号 0:创建挂载运行 1:挂载运行: (任意键退出)' input
echo "输入编号:$input"

case $input in
    0)
    creatStart
    ;;
    1)
    start
    ;;
    *)
    echo -e "${RED}退出sh脚本${RES}"
    exit 0
    ;;
  esac

